package ru.ksu.ktk.diploma.sdi.mapping.learner;

import java.util.List;

import ru.ksu.ktk.diploma.sdi.mapping.Triple;
import ru.ksu.ktk.diploma.sdi.mapping.thesauri.DescriptorPair;

/**
 * Example data for learner
 * 
 * @author coldflame 04.05.2009 21:11:08
 */
public class Example {

    protected Triple firstTriple;
    protected Triple secondTriple;
    protected List<DescriptorPair> descriptorPairs;
    
    

    public Example(Triple firstTriple, Triple secondTriple) {
        this.firstTriple = firstTriple;
        this.secondTriple = secondTriple;
    }

    public Triple getFirstTriple() {
        return firstTriple;
    }

    public void setFirstTriple(Triple firstTriple) {
        this.firstTriple = firstTriple;
    }

    public Triple getSecondTriple() {
        return secondTriple;
    }

    public void setSecondTriple(Triple secondTriple) {
        this.secondTriple = secondTriple;
    }

    public List<DescriptorPair> getDescriptorPairs() {
        return descriptorPairs;
    }

    public void setDescriptorPairs(List<DescriptorPair> descriptorPairs) {
        this.descriptorPairs = descriptorPairs;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof Example)) return false;
        Example e = (Example) o;
        return firstTriple.equals(e.getFirstTriple()) && secondTriple.equals(e.getSecondTriple());
    }

    @Override
    public int hashCode() {
        int result = 17;
        if (firstTriple != null){
            result = 31 * result + firstTriple.hashCode();
        }
        if (secondTriple != null){
            result = 31 * result + secondTriple.hashCode();
        }

        return result;

    }

}